#include "bin.h"
#include "ui_bin.h"

Bin::Bin(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Bin)
{
    ui->setupUi(this);
}

Bin::~Bin()
{
    delete ui;
}

std::string x_;
void Bin::on_zheng_clicked()
{
    c=3.0;
    x=ui->yuncha->text();
    x_=x.toStdString();
    x__=stod(x_);
    Banswer_=x__/c;
    ui->Banswer->setText(QString::number(Banswer_,10,4));
}


void Bin::on_jun_clicked()
{
    c=sqrt(3);
    x=ui->yuncha->text();
    x_=x.toStdString();
    x__=stod(x_);
    Banswer_=x__/c;
    ui->Banswer->setText(QString::number(Banswer_,10,4));
}


void Bin::on_san_clicked()
{
    c=sqrt(6);
    x=ui->yuncha->text();
    x_=x.toStdString();
    x__=stod(x_);
    Banswer_=x__/c;
    ui->Banswer->setText(QString::number(Banswer_,10,4));
}


void Bin::on_fan_clicked()
{
    c=sqrt(2);
    x=ui->yuncha->text();
    x_=x.toStdString();
    x__=stod(x_);
    Banswer_=x__/c;
    ui->Banswer->setText(QString::number(Banswer_,10,4));
}


void Bin::on_pushButton_4_clicked()
{
    c=1.0;
    x=ui->yuncha->text();
    x_=x.toStdString();
    x__=stod(x_);
    Banswer_=x__/c;
    ui->Banswer->setText(QString::number(Banswer_,10,4));
}


void Bin::on_Bback_clicked()
{
    this->hide();
    MainWindow *n=new MainWindow;
    n->show();
}


void Bin::on_Bcontinue_clicked()
{
    this->hide();
    Hun *m=new Hun;
    m->show();
}

